<!DOCTYPE html>
<html lang="en">
<head>
  
<meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <title></title>
  <meta name="viewport" content="initial-scale=1, maximum-scale=1">
  <!-- <link rel="shortcut icon" href="http://favicon.ico"> -->
  <meta name="apple-mobile-web-app-capable" content="yes">
  <meta name="apple-mobile-web-app-status-bar-style" content="black">
  <meta name="viewport" content="width=device-width, height=device-height, user-scalable=no, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0">


  <link rel="stylesheet" href="https://gitee.com/huaflower/ReadBook_CommonFile/raw/master/css/sm.min.css">
  <link rel="stylesheet" href="https://gitee.com/huaflower/ReadBook_CommonFile/raw/master/css/sm-extend.min.css">
  <script type="text/javascript" src="https://gitee.com/huaflower/ReadBook_CommonFile/raw/master/common/common/common.js"></script>
  <style>

    /*修改标题栏颜色*/
    .bar.bar-nav {
      background-color: #1FCA23;
    }

    /*修改标题栏字体颜色*/
    .bar.bar-nav .title {
      color: #fff;
    }
    
    /*修改工具栏背景颜色*/
    .bar.bar-tab {
      background-color: #FEEA4D;
    }
    #pull-left{
      display:inline-block;
      width: 1.5rem;
      padding-top:0.3rem;
      float: left;
    }
    #pull-left img{
      display: block;
      width: 100%;
    }
    #pull-title{
      display: inline-block;
      width: 8.0rem;
      height: 2.2rem;
      line-height: 2.2rem;
      /* float: left; */
      margin-left: 30%;
      color: #fff;
      font-size: 16px;
      text-align: center;
      margin-left: calc(50% - 1.5rem - 4rem);
    }
    /*主题颜色*/
     .themecolor{
       background-color: #1FCA23;
     }
    /*修改内容区背景色*/
    .content{
    	background:#fff;
    }
     #modify{
        width: 100%;
        height: auto;
        float: left;
        margin:10% 0;
       }
    .modify_name{
      width: 100%;
      text-align: center;
     }
     #modify_user{
      width: 80%;
      height:2.0rem;
      font-size: 14px;
      padding:3%;
      border:1px solid #cccbcb;
      border-radius: 4px;
     }
     #logbtn{
      display: block;
      width: 80%;
      height:2.0rem;
      line-height: 2.0rem;
      text-align: center;
      border-radius:3px;
      color:#fff;
      font-size: 16px;
      border:0;
      float: left;
      margin:7% 10%;
    }
     #remind_1{
      width: 80%;
      float: left;
      margin:2% 10%;
      font-size: 14px;
      color:#CD3333;
    }
  </style>
</head>
<body>
  
  <div class="page-group">
    <div class="page">
      <!-- 标题栏 -->
      <header class="bar bar-nav">
         <a href="#" id="pull-left" onclick="backclick()"><img src="https://gitee.com/huaflower/ReadBook_CommonFile/raw/master/img/img/back@2x.png"></a>
         <span id="pull-title">修改姓名</span>
      </header>
      <!-- 页面内容区域 -->
      <div class="content">
         <!-- 登录 -->
         <form action="" method="post" id="modify" name="login">
             <div class="modify_name">
             	<input type="text" name="" placeholder="家长姓名" id="modify_user">
             </div>
             <p id="remind_1"></p>

	         <!-- 登录按钮 -->
	         <a href="#" id="logbtn" class="themecolor" onclick="clkname()">确定</a>
         </form>

      </div>
    </div>
  </div>

  <!-- !-- 固定的js引用，所有的jQuery 要用 $$ 表示 --> 
<script type="text/javascript" src="https://gitee.com/huaflower/ReadBook_CommonFile/raw/master/js/js/jquery-1.11.1.min.js"></script>
<!-- 这一行代码是为了 避免js冲突 -->
<script type="text/javascript">var $$ =jQuery.noConflict();</script>

<script type='text/javascript' src='https://gitee.com/huaflower/ReadBook_CommonFile/raw/master/zepto/zepto/zepto.min.js' charset='utf-8'></script>
<script type='text/javascript' src='https://gitee.com/huaflower/ReadBook_CommonFile/raw/master/js/js/sm.min.js' charset='utf-8'></script>
<!-- <script type='text/javascript' src='https://gitee.com/huaflower/CommonFile/raw/master/js/sm-extend.min.js' charset='utf-8'></script> -->
<script src="https://gitee.com/huaflower/ReadBook_CommonFile/raw/master/js/js/swiper/swiper.min.js"></script>
<script type="text/javascript">

  // 点击返回
  function backclick(){
    native_goto('local/finish');
  }

 function clickmodify(){
    // 填写信息验证
    // 姓名验证
    $$('#modify_user').blur(function(){
       if( $$(this).val()=="") { 
           $$("#remind_1").html("姓名不能为空！");
           return false;
        }
        else {
           $$("#remind_1").html("");
        }
    });

  }

  // 修改信息 数据集成
  function updateUserInfo(){
      var username = $$('#modify_user').val();
      if(!isNotNull(username)){
          native_showdialog("姓名不能为空！");
          return;
      }

      var param = {}
      var url = 'apis/updateUserInfo?name='+username;
      net_request('get',url,param,updateUserInfoSuccessCallBack,errorCallBack);
  }

  // 成功函数调回 修改信息
  function updateUserInfoSuccessCallBack(data){
      if (isNotNull(data) && data.success) {
         
         native_goto('local/finish');
      }else{
         native_showdialog(data.message);
      }
  }

  // 失败函数回调
  function errorCallBack(data){
    
  }
 
  // 点击确定按钮调用接口
  function clkname(){
    updateUserInfo();
  }
  
 
  function getParams(data){
   // data需要转成json调用 ，函数urlParamParseJson();
     /*var jodata = JSON.parse(data); 
     if(isNotNull(jodata)){//
        
     }*/

  }	
    // 初始化
    $(function(){
      $.init();
      clickmodify();
    });
  </script>
</body>
</html>